bitkeeper revision 1.22.2.13 (3e47a8faCADIagB6c2I4F2E1dGdRyw)
authorkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Mon, 10 Feb 2003 13:28:26 +0000 (13:28 +0000)
committerkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Mon, 10 Feb 2003 13:28:26 +0000 (13:28 +0000)
processor.h, traps.c, smpboot.c, process.c:
  Fix bug in fast-trap handling.

xen-2.4.16/arch/i386/process.c
xen-2.4.16/arch/i386/smpboot.c
xen-2.4.16/arch/i386/traps.c
xen-2.4.16/include/asm-i386/processor.h

index 9eecfef2f5b5050567fc25bc3bc4104d618ae7ef..a23f4b1557453323908b2d7571cbeb7c12a0d8ce 100644 (file)
@@ -326,9 +326,7 @@ void new_thread(struct task_struct *p,
     regs->eflags |= X86_EFLAGS_IF;
 
     /* No fast trap at start of day. */
-    p->thread.fast_trap_idx    = 0x20;
-    p->thread.fast_trap_desc.a = 0;
-    p->thread.fast_trap_desc.b = 0;
+    SET_DEFAULT_FAST_TRAP(&p->thread);
 }
 
 
index 0dfd12317897a3d1f435267056ee96939ac2f4b8..dd0f94bd137b0082ea7a9eac1f0caf52df1dc1fd 100644 (file)
@@ -685,6 +685,8 @@ static void __init do_boot_cpu (int apicid)
     idle->thread.esp = idle->thread.esp0 = (unsigned long)idle + THREAD_SIZE;
     idle->thread.eip = (unsigned long) start_secondary;
 
+    SET_DEFAULT_FAST_TRAP(&idle->thread);
+
     /* start_eip had better be page-aligned! */
     start_eip = setup_trampoline();
 
index 59f293c8f904c1eb94968ce433e5a1d50afa4239..cdea19eaa63e19c3a9350753dcd66db458ca6879 100644 (file)
@@ -580,10 +580,7 @@ long do_set_fast_trap(int idx)
     if ( idx == 0 )
     {
         CLEAR_FAST_TRAP(&current->thread);
-        memset(idt_table+current->thread.fast_trap_idx, 0, 8);
-        current->thread.fast_trap_idx    = 0x20;
-        current->thread.fast_trap_desc.a = 0;
-        current->thread.fast_trap_desc.b = 0;
+        SET_DEFAULT_FAST_TRAP(&current->thread);
         return 0;
     }
 
index 02868d5b2378d7203010e42f7e89c4ae16b30947..f7f949d82b6395236c4d1be06dda62091f4d77a5 100644 (file)
@@ -358,8 +358,14 @@ struct thread_struct {
     trap_info_t         traps[256];
 };
 
+#define SET_DEFAULT_FAST_TRAP(_p) \
+    (_p)->fast_trap_idx = 0x20;   \
+    (_p)->fast_trap_desc.a = 0;   \
+    (_p)->fast_trap_desc.b = 0;
+
 #define CLEAR_FAST_TRAP(_p) \
     (memset(idt_table + (_p)->fast_trap_idx, 0, 8))
+
 #define SET_FAST_TRAP(_p)   \
     (memcpy(idt_table + (_p)->fast_trap_idx, &((_p)->fast_trap_desc), 8))
 
@@ -369,7 +375,7 @@ struct thread_struct {
        { [0 ... 7] = 0 },      /* debugging registers */       \
        0, 0, 0,                                                \
        { { 0, }, },            /* 387 state */                 \
-       0, { 0, 0 },                                            \
+       0x20, { 0, 0 },         /* DEFAULT_FAST_TRAP */         \
        { {0} }                 /* io permissions */            \
 }